<template>
	<view class="wrap safe-area">
		<uParse :html="content" />
	</view>
</template>

<script>
	import uParse from "@/components/uParse/uParse.vue";
	export default {
		components: {
			uParse,
		},
		data() {
			return {
				content: "",
				name: "",
				id: "",
			};
		},
		onLoad(options) {
			uni.setNavigationBarTitle({
				title: options.title,
			});
			if (options.name) {
				this.name = options.name;
			}
			if (options.id) {
				this.id = options.id;
			}

			this.getData();
		},
		methods: {
			/**
			 * 获取接口
			 */
			getData(name) {
				this.$commonNetwork.getRichTextData(this.name, this.id, (res) => {
					this.content = res.content;
				});
			},
		},
	};
</script>

<style lang="scss" scoped>
	.wrap {
		padding: 25rpx;
		box-sizing: border-box;
	}
</style>
